#include "stdio.h"
#include "stdlib.h"
void print(unsigned int val, int dup)
{
	unsigned int high,low;
	high = val >> 16;
	low  = val &  0x0000ffff;
	printf("%03x-%04x %d\n",high,low,dup);
}
int compare(const void* arg1, const void* arg2)
{
	if(*(unsigned int *)arg1==*(unsigned int *)arg2)
		return 0;
	else if(*(unsigned int *)arg1<*(unsigned int *)arg2)
		return -1;
	else return 1;
}

int main(){
	char map[]={
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,0,0,0,0,0,
		0,0,0,0,0,
		2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9};
	int memo_len;
	scanf("%d\n",&memo_len);
	unsigned int *memo=new unsigned int[memo_len];
	unsigned int temp_memo;
	unsigned int i;
	for(i=0;i<memo_len;i++){
		temp_memo=0;
		int read_pos=0;
		char c;
		char byte_head;
		while((c=getchar())!='\n'){
			byte_head= c & 0xf0;
			if(byte_head==0x40 || byte_head==0x50)
			{
				temp_memo =  temp_memo << 4;
				temp_memo |= map[c];
			}
			else if(byte_head == 0x30){
				temp_memo =  temp_memo << 4;
				temp_memo |= (c & 0x0f);
			}
			else
				continue;
		}
		memo[i]=temp_memo;
	}
	qsort(memo, memo_len, sizeof(int), compare);
	bool has_dup=false;
	int count;
	for(i=0;i<memo_len;)
	{
		count=1;
		while(memo[i]==memo[i+count])
			count++;
		if(count>1)
		{
			has_dup=true;
			print(memo[i],count);
		}
		i+=count;
	}
	if(!has_dup)
	{
		printf("No duplicates.\n");
	}
	return 0;
}
